#include<iostream>
using namespace std;
int Bag[10001]; 
bool F(int n, int s){
	if (s == 0)    return true;
	else if (s<0 || s>0 && n<1)  return false;
	if (F(n-1, s-Bag[n-1])) return true;
	return F(n-1, s);
}
int main(){
	int s, n;
	while (cin >> s >> n){
		for (int i = 0; i < n; i++){
			cin >> Bag[i];
		}
		F(n, s)? cout << "YES\n": cout << "NO\n";
	}
	return 0;
} 
